package org.ash.user.pojo.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import static org.ash.base.constant.MessageConstant.PHONE_FORMAT_INCORRECT;


@Data
@ApiModel(description = "简化版用户注册表单")
public class RegisterFormDTO {

    @ApiModelProperty(value = "用户名", required = true)
    @NotBlank(message = "用户名不能为空")
    private String username;

    @ApiModelProperty(value = "密码", required = true)
    @NotBlank(message = "密码不能为空")
    private String password;

    @ApiModelProperty(value = "电话", required = true)
    @Pattern(regexp = "^[1][3-9][0-9]{9}$", message = PHONE_FORMAT_INCORRECT)
    private String phone;

}
